// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import moveInput from "./moveInput";

const {ccclass, property} = cc._decorator;

@ccclass
export default class playerControl extends cc.Component {

    // 速度
    speed: number = 100;

    // onLoad () {}

    start () {

    }

    update (dt) {
        // 移动
        this.node.x += this.speed * dt * moveInput.Instance().horizontal;
        this.node.y += this.speed * dt * moveInput.Instance().vertical;
    }
}
